﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="fsw.Web.Manager.List" ValidateRequest="false" %>
<%@ Import Namespace="fsw.Common" %>
<%@ Register Src="~/HeaderJs.ascx" TagPrefix="uc1" TagName="HeaderJs" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />
    <title>管理员列表</title>
    <uc1:HeaderJs runat="server" ID="HeaderJs" />
</head>
<body>
    <div class="position">当前位置：<a href="List.aspx">管理员管理</a></div>
    <div class="border">
        <form id="form1" runat="server">
            <div class="am-btn-group">
                <a href="Add.aspx" class="am-btn am-btn-secondary am-radius am-text-sm"><span class="am-icon-plus am-margin-right-sm"></span>添加管理员</a>
            </div>
            <div class="am-btn-group am-margin-left-xs">
                <a class="am-btn am-btn-secondary am-radius am-text-sm"><span class="am-icon-files-o am-margin-right-sm"></span>按管理组查看</a>
                <div class="am-dropdown" data-am-dropdown>
                    <button class="am-btn am-btn-secondary am-dropdown-toggle am-text-sm" data-am-dropdown-toggle><span class="am-icon-caret-down"></span></button>
                    <ul class="am-dropdown-content">
                        <li><a href="List.aspx">全部管理</a></li>
                        <li class="am-divider"></li>
                        <li><a href="List.aspx?tid=1&aid=<%=this._active %>">超级管理员</a></li>
                        <li class="am-divider"></li>
                        <li><a href="List.aspx?tid=2&aid=<%=this._active %>">普通管理员</a></li>
                        <li class="am-divider"></li>
                    </ul>
                </div>
            </div>
            <div class="am-btn-group am-btn-group-sm am-btn-toolbar am-margin-left-xs">
                <a class="am-btn am-btn-<%=this._active==0?"warning":"default" %> am-radius" href="List.aspx">全部</a>
                <a class="am-btn am-btn-<%=this._active==1?"warning":"default" %> am-radius" href="List.aspx?aid=1&tid=<%=this._typeid %>">启用</a>
                <a class="am-btn am-btn-<%=this._active==2?"warning":"default" %> am-radius" href="List.aspx?aid=2&tid=<%=this._typeid %>">锁定</a>
            </div>
            <div class="am-form am-form-inline am-fr">
                <div class="am-form-group am-form-icon">
                    <i class="am-icon-search"></i>
                    <asp:TextBox ID="txtKeywords" runat="server" CssClass="am-form-field am-input-sm" placeholder="请输入关键字" />
                    <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="am-btn am-btn-warning am-radius am-text-sm" OnClick="lbtnSearch_Click">搜索</asp:LinkButton>
                </div>
            </div>
            <div class="am-cf"></div>
                        <asp:Repeater ID="rptList" runat="server">
                <HeaderTemplate>
                    <table class="am-table am-table-hover am-margin-top">
                        <thead>
                            <tr>
                                <th width="80">ID</th>
                                <th width="150">用户名</th>
                                <th width="150">中文名</th>
                                <th width="150">会员组</th>                                
                                <th width="180">最后登录ip</th>
                                <th width="180">最后登录日期</th>
                                <th width="80">状态</th>
                                <th width="250">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td><%#Eval("Id") %></td>
                        <td><%#Eval("UserName") %></td>
                        <td><%#Eval("RealName") %></td>
                        <td><%#int.Parse( Eval("TypeId").ToString())==1?"超级管理员":"普通管理员" %></td>                        
                        <td><%#Eval("LastIP") %></td>
                        <td><%# Utils.GetTime( Eval("LastTime").ToString()).ToString() %></td>
                        <td><%#int.Parse(Eval("isStatus").ToString())==0?"锁定":"启用" %></td>
                        <td><a href="Edit.aspx?id=<%#Eval("Id") %>"><span class="am-icon-edit"></span>编辑</a>　<a href="javascript:;" class="del" rel="List.aspx?action=del&id=<%#Eval("Id") %>"><span class="am-icon-trash"></span><%#int.Parse(Eval("isStatus").ToString())==1?"锁定":"启用" %></a></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <%#rptList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"9\">暂无记录</td></tr>" : ""%> </tbody>
                 </table>
                </FooterTemplate>
            </asp:Repeater>

            <div class="border-top am-padding">
                <div class="am-u-sm-10 pagelist">
                    <ul>
                        <div id="PageContent" runat="server" class="am-fl"></div>
                        <div class="am-fr">
                            <asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                                OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox>条/页
                        </div>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
        </form>
    </div>
    <script>
        $(function () {
            $(".del").click(function () {
                var _this = $(this);
                var url = _this.attr("rel");
                layer.confirm(
                    '确定要删除？不可恢复！',
                    {
                        btn: ['确定', '取消']
                    }, function () {
                        $.ajax({
                            url: url, type: 'post', dataType: 'json',
                            error: function (e) { alert(e.responseText); },
                            success: function (d) {
                                layer.closeAll();
                                if (d.state == 'success') {
                                    toastr.success(d.msg);
                                    _this.parent().parent().remove();
                                }
                                else {
                                    toastr.error(d.msg);
                                }
                            }
                        })
                    }, function () {

                    });
            })

        })
    </script>
</body>
</html>
